package com.wzq.app.utils.permission;

/**
 * @author ruchen on 2016/5/12/0012.
 */
public class PermissionConstains {
    public final static int PERMISSION_RESULT_CODE_CAMERA_ANSWERSHEET = 100;   //拍摄答题卡权限
    public final static int PERMISSION_RESULT_CODE_CAMERA_CAPTURE_LISTENER = 101;       //摄像头扫描二维码权限听力
    public final static int PERMISSION_RESULT_CODE_CAMERA_CAPTURE_CREATE_EXAM = 102;       //摄像头扫描二维码权限创建考试
    public final static int PERMISSION_RESULT_CODE_CAMERA_CAPTURE_CREATE_HOMEWORK = 107;       //摄像头扫描二维码权限创建作业
    public final static int PERMISSION_RESULT_CODE_PHONE = 103;                //电话权限
    public final static int PERMISSION_RESULT_CODE_WRITE_STORAGE = 104;        //写答题卡权限
    public final static int PERMISSION_RESULT_CODE_LOCATION = 105;             //定位权限
    public final static int PERMISSION_RESULT_CODE_CAMERA_FEEDBACK = 106;   //用户反馈权限申请
    public final static int PERMISSION_RESULT_CODE_CAMERA = 107;   //摄像头权限
    public final static int PERMISSION_RESULT_AUDIO_RECORD = 108;//录音权限
    public final static int PERMISSION_RESULT_CALL_PHONE = 110;//打电话权限
    public final static int PERMISSION_RESULT_CODE_ALL = 109;   //所有权限


    public final static String PERMISSION_REQUEST_MSG_SCAN_SHEET = "拍摄答题卡时需要摄像头权限.请允许应用获得该权限!";
    public final static String PERMISSION_REQUEST_MSG_QRCODE = "扫描二维码时需要摄像头权限.请允许应用获得该权限!";
    public final static String PERMISSION_REQUEST_MSG_STORAGE = "应用需要SD卡读写权限.请允许应用获得该权限!";
    public final static String PERMISSION_REQUEST_MSG_FEEDBACK_CAMERA = "反馈拍照需要摄像头权限,请允许应用获得该权限!";
    public final static String PERMISSION_REQUEST_MSG_DEFAULT = "为了使您可以正常使用应用,请允许应用获得该权限!";
    public final static String PERMISSION_REQUEST_MSG_CAMERA = "为了使您可以正常使用应用,请允许应用获得摄像头权限!";
    public final static String PERMISSION_REQUEST_MSG_AUDIO = "为了使您可以正常使用应用,请允许应用获得摄像头权限!";


    public static String getMessage(int requestCode) {
        String message = "";
        switch (requestCode) {
            case PermissionConstains.PERMISSION_RESULT_CODE_CAMERA_ANSWERSHEET:
                message = PermissionConstains.PERMISSION_REQUEST_MSG_SCAN_SHEET;
                break;
            case PermissionConstains.PERMISSION_RESULT_CODE_CAMERA_CAPTURE_CREATE_EXAM:
            case PermissionConstains.PERMISSION_RESULT_CODE_CAMERA_CAPTURE_LISTENER:
                message = PermissionConstains.PERMISSION_REQUEST_MSG_QRCODE;
                break;
            case PermissionConstains.PERMISSION_RESULT_CODE_WRITE_STORAGE:
                message = PermissionConstains.PERMISSION_REQUEST_MSG_STORAGE;
                break;
            case PermissionConstains.PERMISSION_RESULT_CODE_CAMERA_FEEDBACK:
                message = PermissionConstains.PERMISSION_REQUEST_MSG_FEEDBACK_CAMERA;
                break;
            case PermissionConstains.PERMISSION_RESULT_CODE_CAMERA:
                message = PermissionConstains.PERMISSION_REQUEST_MSG_CAMERA;
                break;
            case PERMISSION_RESULT_AUDIO_RECORD:
                message = PermissionConstains.PERMISSION_REQUEST_MSG_AUDIO;
                break;
            default:
                message = PermissionConstains.PERMISSION_REQUEST_MSG_DEFAULT;
        }

        return message;
    }
}
